package com.eascs.o2o.recruit.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.eascs.app.dao.JdbcSession;
import com.eascs.o2o.recruit.entity.RecruitInfoVO;
import com.eascs.o2o.recruit.service.RecruitService;

@Service("recruitServiceImpl")
public class RecruitServiceImpl implements RecruitService{
	
	@Autowired
	@Qualifier("wxSession")
	protected JdbcSession jdbcSession;

	@Override
	public int saveRecruitInfo(RecruitInfoVO recruitInfoVO) {
		return jdbcSession.insert(recruitInfoVO);
	}

	@Override
	public List<RecruitInfoVO> queryRecruitInfo(RecruitInfoVO recruitInfoVO) {
		String uname=recruitInfoVO.getUname();
		String telphone=recruitInfoVO.getTelphone();
		if(uname.isEmpty() &&"null".equals(uname)){
			return null;
		}
		if(telphone.isEmpty() &&"null".equals(telphone)){
			return null;
		}
		String sql="SELECT * FROM recruit_info WHERE uname=? AND telphone=?";
		List<RecruitInfoVO> list=jdbcSession.findEntitys(sql, RecruitInfoVO.class, new Object[] {uname,telphone});
		return list;
	}

}
